import Vue from 'vue'
import Vuex from 'vuex'
import persist from 'vuex-persistedstate'
Vue.use(persist)
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    list:[],
  },
  mutations: {
    add(state,value){
      state.list.push(value)
    },
    del(state,item){
      state.list.forEach((e,i)=>{
        if(e.id == item.id){
          state.list.splice(i,1)
        }
      })
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [persist()]
})
